//
//  DAImageView.h
//  DAKnowledge
//
//  Created by DreamArts on 16/4/27.
//  Copyright © 2016年 lidongyang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
#import "DAKnowledge-swift.h"

@class PushPinView;

@protocol DAImageViewDelegate <NSObject>

- (void)viewDragFinished;

- (void)viewWillReturn;

@end
@interface DAImageView : UIImageView 

/*!
 @override method  initWithFrame:
 @abstract  frame构造方法
 @discussion 构造一个imageView实例
 @param frame
 @result UIImageView
 */
- (instancetype)initWithFrame:(CGRect)frame;
- (void)showOnView:(UIView *)sView;
@property(nonatomic, weak) id<DAImageViewDelegate>delegate;
@property(nonatomic, strong)PushPinView *pushPin;
@property(nonatomic)BOOL gravityEnabled;
@property(nonatomic, strong) UIView *backView;
@property(nonatomic,strong)CMMotionManager *motionManager;
- (void)viewReturn;

@end

@protocol PushPinViewDelegate <NSObject>

- (void)viewDragFinished:(UIPanGestureRecognizer *)ges;

@end

@interface PushPinView : UIView

@property(nonatomic, weak) id<PushPinViewDelegate>delegate;
//父视图
@property(nonatomic, strong) UIView *containerView;

@property(nonatomic, strong) UIImageView *pushPinImageView;

//气泡的直径
@property(nonatomic, assign) CGFloat bubbleWidth;

//气泡粘性系数，越大可以拉得越长
@property(nonatomic, assign) CGFloat viscosity;

//气泡颜色
@property(nonatomic, strong) UIColor *bubbleColor;

//需要隐藏气泡时候可以使用这个属性：self.frontView.hidden = YES;
@property(nonatomic, strong) UIView *frontView;

- (id)initWithPoint:(CGPoint)point superView:(UIView *)view;
- (void)setUp;
- (void)dragImageView:(UIPanGestureRecognizer *)ges;
@end
